/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.star.modules.sys.entity;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 信息发布(关于我们、资讯百科、新闻动态)Entity
 * @author L
 * @version 2018-09-03
 */
@Table(name="${_prefix}info", alias="a", columns={
		@Column(name="id", attrName="id", label="用户ID", isPK=true),
		@Column(name="title", attrName="title", label="标题", queryType=QueryType.LIKE),
		@Column(name="type", attrName="type", label="类型", comment="类型(数据字典,扩展int1为1时为单篇)"),
		@Column(name="menu_col", attrName="menuCol", label="栏目"),
		@Column(name="source", attrName="source", label="来源", comment="来源(默认来源REMAX天津)"),
		@Column(name="thumbnail", attrName="thumbnail", label="缩略图"),
		@Column(name="describe", attrName="describe", label="简介"),
		@Column(name="content", attrName="content", label="内容", comment="内容(富文本)"),
		@Column(name="visit_num", attrName="visitNum", label="访问数量"),
		@Column(name = "is_hot", attrName = "isHot", label = "是否热门"),
		@Column(name = "tkd_title", attrName = "tkdTitle", label = "tkd标题"),
		@Column(name = "tkd_keywords", attrName = "tkdKeywords", label = "tkd关键字"),
		@Column(name = "tkd_desc", attrName = "tkdDesc", label = "tkd描述"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.status , a.update_date desc"
)
public class ShInfo extends DataEntity<ShInfo> {
	
	private static final long serialVersionUID = 1L;
	private String title;		// 标题
	private Integer type;		// 类型(数据字典,扩展int1为1时为单篇)
	private Integer menuCol;
	private String source;		// 来源(默认来源REMAX天津)
	private String thumbnail;		// 缩略图
	private String describe;		// 简介
	private String content;		// 内容(富文本)
	private Integer visitNum;		// 访问数量
	private Boolean isHot;
	private String tkdTitle;
	private String tkdKeywords;
	private String tkdDesc;

	public Integer getMenuCol() {
		return menuCol;
	}

	public void setMenuCol(Integer menuCol) {
		this.menuCol = menuCol;
	}

	public Boolean getIsHot() {
		return isHot;
	}

	public void setIsHot(Boolean hot) {
		isHot = hot;
	}

	public String getTkdTitle() {
		return tkdTitle;
	}

	public void setTkdTitle(String tkdTitle) {
		this.tkdTitle = tkdTitle;
	}

	public String getTkdKeywords() {
		return tkdKeywords;
	}

	public void setTkdKeywords(String tkdKeywords) {
		this.tkdKeywords = tkdKeywords;
	}

	public String getTkdDesc() {
		return tkdDesc;
	}

	public void setTkdDesc(String tkdDesc) {
		this.tkdDesc = tkdDesc;
	}

	public ShInfo() {
		this(null);
	}

	public ShInfo(String id){
		super(id);
	}
	
	@NotBlank(message="标题不能为空")
	@Length(min=0, max=100, message="标题长度不能超过 100 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@NotNull(message="类型不能为空")
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}
	
	@Length(min=0, max=20, message="来源长度不能超过 20 个字符")
	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
	
	public String getThumbnail() {
		return thumbnail;
	}

	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}
	
	@Length(min=0, max=100, message="简介长度不能超过 100 个字符")
	public String getDescribe() {
		return describe;
	}

	public void setDescribe(String describe) {
		this.describe = describe;
	}
	
	@NotBlank(message="内容不能为空")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	public Integer getVisitNum() {
		return visitNum;
	}

	public void setVisitNum(Integer visitNum) {
		this.visitNum = visitNum;
	}
	
	public Integer getVisitNum_gte() {
		return sqlMap.getWhere().getValue("visit_num", QueryType.GTE);
	}

	public void setVisitNum_gte(Integer visitNum) {
		sqlMap.getWhere().and("visit_num", QueryType.GTE, visitNum);
	}
	
	public Integer getVisitNum_lte() {
		return sqlMap.getWhere().getValue("visit_num", QueryType.LTE);
	}

	public void setVisitNum_lte(Integer visitNum) {
		sqlMap.getWhere().and("visit_num", QueryType.LTE, visitNum);
	}
	
}